<?php
require_once 'db.php';
class Works extends DB{
    
    public function countPage() {
        $this->getConnection();
        $query = 'SELECT * FROM works ';
        $works = $this->query($query);
        return count($works);
    }

   public function Page($page = NULL) {
        $first = ($page - 1) * PAGE;
        $this->getConnection();
        $query = "SELECT name ,id,name,company_name,description,url,posted
                 FROM works
                 LIMIT " . $first . "," . PAGE;
        $works = $this->query($query);
        return $works;
    }
    
}




    
?>
